﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

namespace OnlineManagement.Web.pages
{
    public partial class PropagateRecord : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!Page.IsPostBack){
                BindDropdownlist(1001);
            }
        }
        private void BindDropdownlist(int hoggeryId) {
            BLL.Sow sowBll = new BLL.Sow();
            StringBuilder sb = new System.Text.StringBuilder();
            sb.Append("HoggeryID=").Append(hoggeryId)
                .Append("and PropagateStateID in (select StateID from PropagateState where PropagateStateName='分娩')");
            System.Data.DataSet ds= sowBll.GetList(sb.ToString());
            if(ds!=null){
                ddlSowId.DataSource = ds;
                ddlSowId.DataTextField = "BitID";
                ddlSowId.DataValueField = "SowID";
                ddlSowId.DataBind();
            }
        }
    }
}